﻿@inject IDataCacheService _dataCacheService

@if (Model.Tags.Any())
{
    <MDCard Class="pa-2 mb-4">
        <div class="row">
            @{ var i = 0;}
            @foreach (var item in Model.Tags.OrderByDescending(s => s.Children.Count))
            {

                <div class="col-12 col-lg-6">
                    <TagsRow Model="item" OnChanged="OnChanged" Color="@GetColor(i)" TotalCount="Model.CVInfors.Count" />
                </div>
                i++;
            }
        </div>

    </MDCard>
}


@code {
    [Parameter]
    public CVThematicPageViewModel Model { get; set; } = new CVThematicPageViewModel();
    [Parameter]
    public EventCallback OnChanged { get; set; }

    public string GetColor(int index)
    {
        return index switch {  _ => "primary" };
    }
}
